﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="company_edit.aspx.cs" Inherits="Donal.Xms.Web.qianyi.common.company_edit" ValidateRequest="false" %>

<%@ Import Namespace="Donal.Xms.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>编辑会员</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" type="text/css" href="../../scripts/artdialog/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" href="../skin/icon/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
    <link href="../../css/pagination.css" rel="stylesheet" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="gb2312" src="../../scripts/jquery/PCASClass.js?v=202208311727"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/webuploader/webuploader.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/uploader.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/datepicker/WdatePicker.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();

            var mypcas;

            <%if (p != "" && c != "" && a != "")
        {%>

            mypcas = new PCAS('txtProvince,<%=p%>', 'txtCity,<%=c%>', 'txtArea,<%=a%>');

            <%}
        else
        {%>
            mypcas = new PCAS("txtProvince,所属省份", "txtCity,所属城市", "txtArea,所属地区");

            <%}%>

            $("select.select").change(function () {

                $("[id$='" + $(this).attr("name").replace("txt", "hid") + "']").val($(this).val());

                if ($(this).attr("name") == "txtProvince") {
                    $("[id$='hidCity']").val($("#txtCity").val());
                    $("[id$='hidArea']").val($("#txtArea").val());
                } else if ($(this).attr("name") == "txtCity") {
                    $("[id$='hidArea']").val($("#txtArea").val());
                }

            });

        });


    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="user_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
            <a href="../center.aspx"><i class="iconfont icon-home"></i><span>首页</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <a href="user_list.aspx"><span>会员管理</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>编辑会员</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a <%=(pageindex==0?"class=\"selected\"":"") %> href="javascript:;">公司信息</a></li>
                        <li><a href="javascript:;">账户信息</a></li>

                        <%if (action != DTEnums.ActionEnum.Add.ToString())
                            { %>
                        <li><a <%=(pageindex == 4 ? "class=\"selected\"" : "") %> href="company_edit.aspx?id=<%=id %>&action=<%=action %>&pageindex=4">消费记录</a></li>
                        <li><a <%=(pageindex == 2 ? "class=\"selected\"" : "") %> href="company_edit.aspx?id=<%=id %>&action=<%=action %>&pageindex=2">账号管理</a></li>
                        <li><a <%=(pageindex == 1 ? "class=\"selected\"" : "") %> href="company_edit.aspx?id=<%=id %>&action=<%=action %>&pageindex=1">地址管理</a></li>
                        <li><a <%=(pageindex == 5 ? "class=\"selected\"" : "") %> href="company_edit.aspx?id=<%=id %>&action=<%=action %>&pageindex=5">发票管理</a></li>
                        <li><a <%=(pageindex == 3 ? "class=\"selected\"" : "") %> href="company_edit.aspx?id=<%=id %>&action=<%=action %>&pageindex=3">开票记录</a></li>
                        <%} %>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content" <%=(pageindex!=0?"style=\"display: none;\"":"") %>>
            <dl>
                <dt>所属行业</dt>
                <dd>
                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlIndustry" runat="server" datatype="*" errormsg="请选择行业" sucmsg=" "></asp:DropDownList>
                    </div>
                </dd>
            </dl>

            <dl>
                <dt>会员状态</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">正常</asp:ListItem>
                            <asp:ListItem Value="1">冻结</asp:ListItem>
                            <asp:ListItem Value="2">待审核</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                    <span class="Validform_checktip">*禁用账户无法登录</span>
                </dd>
            </dl>

            <dl>
                <dt>会员编号</dt>
                <dd>
                    <asp:TextBox ID="txtErpCode" runat="server" CssClass="input normal" Width="200" MaxLength="150" Enabled="false" datatype="*0-150" sucmsg=" " />
                    <span class="Validform_checktip">会员编号最多150个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>会员名称</dt>
                <dd>
                    <asp:TextBox ID="txtCompanyName" runat="server" CssClass="input normal" Width="400" MaxLength="150" datatype="*2-150" sucmsg=" " />
                    <span class="Validform_checktip">会员名称最多150个字符</span>
                </dd>
            </dl>           
            <dl>
                <dt>公司电话</dt>
                <dd>
                    <asp:TextBox ID="txtTel" runat="server" CssClass="input normal" Width="200" MaxLength="50" datatype="/(^$)|(^.{7,30}$)/" sucmsg=" " />
                    <span class="Validform_checktip">公司电话最多50个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>公司传真</dt>
                <dd>
                    <asp:TextBox ID="txtFax" runat="server" CssClass="input normal" Width="200" MaxLength="50" datatype="/(^$)|(^.{7,30}$)/" sucmsg=" " />
                    <span class="Validform_checktip">公司传真最多50个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>地区</dt>
                <dd>
                    <select id="txtProvince" name="txtProvince" class="select"></select>
                    <input type="hidden" id="hidProvince" runat="server" />
                    <select id="txtCity" name="txtCity" class="select"></select>
                    <input type="hidden" id="hidCity" runat="server" />
                    <select id="txtArea" name="txtArea" class="select"></select>
                    <input type="hidden" id="hidArea" runat="server" />
                </dd>
            </dl>
            <dl>
                <dt>地址</dt>
                <dd>
                    <asp:TextBox ID="txtAddress" runat="server" CssClass="input normal" Width="400" MaxLength="200" datatype="*0-200" sucmsg=" " />
                    <span class="Validform_checktip">地址最多200个字符</span>
                </dd>
            </dl>

            <dl>
                <dt>是否包邮</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblIsPostage" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>

            <dl>
                <dt>添加时间</dt>
                <dd>
                    <asp:TextBox ID="txtAdd_time" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
                    <span class="Validform_checktip">不选择默认当前发布时间</span>
                </dd>
            </dl>

        </div>

        <div class="tab-content" style="display: none;">
            <dl>
                <dt>所属等级</dt>
                <dd>
                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlGroupId" runat="server" datatype="*" errormsg="请选择等级" sucmsg=" "></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>会员类型</dt>
                <dd>
                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlUserTypes" runat="server" datatype="*" errormsg="请选择类型" sucmsg=" ">
                            <asp:ListItem Value="0" Selected="True">普通</asp:ListItem>
                            <asp:ListItem Value="1">月结</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>订单/信用额度</dt>
                <dd>
                    <asp:TextBox ID="txtOrderLimit" runat="server" CssClass="input small" Width="200" datatype="/^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/" sucmsg=" " Text="0.00" />
                    <span class="Validform_checktip">可以下多少钱的订单</span>
                </dd>
            </dl>
            <dl>
                <dt>账户/可用额度</dt>
                <dd>
                    <asp:TextBox ID="txtAmount" runat="server" CssClass="input small" Width="200" datatype="/^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/" sucmsg=" " Text="0.00" />
                    <span class="Validform_checktip">账户中可用余额</span>
                </dd>
            </dl>
            <dl>
                <dt>发票类型</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblInvoiceType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1">专用发票</asp:ListItem>
                            <asp:ListItem Value="2" Selected="True">普通发票</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                    <span class="Validform_checktip">*禁用账户无法登录</span>
                </dd>
            </dl>
            <dl>
                <dt>发票税点</dt>
                <dd>
                    <asp:TextBox ID="txtTaxPoint" runat="server" CssClass="input small" Width="100" MaxLength="2" sucmsg=" " Text="6" />
                    <span class="Validform_checktip">发票税点</span>
                </dd>
            </dl>
            <dl>
                <dt>税率</dt>
                <dd>
                    <asp:TextBox ID="txtSl" runat="server" CssClass="input normal" Width="200" MaxLength="2" sucmsg=" " Text="6" />
                    <span class="Validform_checktip">税率最多50个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>开户账号</dt>
                <dd>
                    <asp:TextBox ID="txtBankAccount" runat="server" CssClass="input normal" Width="200" MaxLength="50" datatype="*0-50" sucmsg=" " />
                    <span class="Validform_checktip">账号最多50个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>税号</dt>
                <dd>
                    <asp:TextBox ID="txtCompanyCode" runat="server" CssClass="input normal" Width="200" MaxLength="50" datatype="*0-50" sucmsg=" " />
                    <span class="Validform_checktip">税号最多50个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>开户行</dt>
                <dd>
                    <asp:TextBox ID="txtBankName" runat="server" CssClass="input normal" Width="200" MaxLength="100" datatype="*0-100" sucmsg=" " />
                    <span class="Validform_checktip">开户行最多100个字符</span>
                </dd>
            </dl>
            <dl>
                <dt>登记日期</dt>
                <dd>
                    <asp:TextBox ID="txtCreateTime" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="/^\s*$|\d{4}\-\d{1,2}\-\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
                    <asp:Label ID="div_CreateTime_tip" runat="server" CssClass="Validform_checktip" />
                </dd>
            </dl>
            <dl>
                <dt>登记人</dt>
                <dd>
                    <asp:TextBox ID="txtAuthor" runat="server" CssClass="input normal" Width="200" MaxLength="50" datatype="*0-50" sucmsg=" " />
                    <span class="Validform_checktip">登记人最多50个字符</span>
                </dd>
            </dl>

        </div>

        <%if (action != DTEnums.ActionEnum.Add.ToString())
            { %>


        <div class="tab-content" <%=(pageindex!=4?"style=\"display: none;\"":"") %>>

            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">
                            <div class="menu-list">
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlCashFrom" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCashFrom_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">资金来源</asp:ListItem>
                                        <asp:ListItem Value="1">账户充值</asp:ListItem>
                                        <asp:ListItem Value="2">财务修改</asp:ListItem>
                                        <asp:ListItem Value="3">网上付款</asp:ListItem>
                                        <asp:ListItem Value="6">购买商品</asp:ListItem>
                                        <asp:ListItem Value="4">交易退款</asp:ListItem>
                                        <asp:ListItem Value="5">营销活动</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtRecodeKey" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnRecodeFind" runat="server" CssClass="btn-search" OnClick="btnRecodeFind_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">
                <asp:Repeater ID="rptRecode" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th align="center" width="5%">会员编号</th>
                                <th align="center" width="15%">会员简称</th>
                                <th align="center" width="5%">会员等级</th>
                                <th align="center" width="5%">会员类型</th>
                                <th align="center" width="10%">订单号</th>
                                <th align="center" width="5%">操作员</th>
                                <th align="center" width="5%">资金来源</th>
                                <th align="center" width="5%">期初</th>
                                <th align="center" width="5%">新增</th>
                                <th align="center" width="5%">期末</th>
                                <th align="center" width="10%">创建时间</th>
                                <th align="center" width="15%">备注</th>
                                <th align="center" width="5%">修改备注</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center"><%#Eval("company_code")%></td>
                            <td align="center"><%#Eval("company")%></td>
                            <td align="center"><%#Eval("company_group")%></td>
                            <td align="center"><%#Eval("company_type")%></td>
                            <td align="center"><%#Eval("order_no")%></td>
                            <td align="center"><%#Eval("operators")%></td>
                            <td align="center"><%#Eval("cash_from")%></td>
                            <td align="center"><%#Eval("cash_up")%></td>
                            <td align="center"><%#Eval("cash_middle")%></td>
                            <td align="center"><%#Eval("cash_down")%></td>
                            <td align="center"><%#Eval("add_time")%></td>
                            <td align="center" id="cashRemark<%#Eval("id")%>"><%#Eval("remark")%></td>
                            <td align="center">
                                <a style="cursor: pointer" onclick="ModifyRemark(this);" id="<%#Eval("id")%>">修改</a>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptRecode.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"13\">暂无记录</td></tr>" : ""%>
                    </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <!--/列表-->

            <!--内容底部-->
            <div class="line20"></div>
            <div class="pagelist">
                <div class="l-btns">
                    <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                        OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
                </div>
                <div id="PageContent" runat="server" class="default"></div>
            </div>
            <!--/内容底部-->



        </div>

        <div class="tab-content" <%=(pageindex!=2?"style=\"display: none;\"":"") %>>
            <script>

                //发送短信
                function PostSMS(mobile) {
                    var mobiles = "";
                    if (arguments.length == 1) { //如果有传入值
                        mobiles = mobile;
                    } else {
                        lenNum = $(".checkall input:checked").length;
                        $(".checkall input:checked").each(function (i) {
                            if ($(this).parent().siblings('input[name="hidMobile"]').val() != "") {
                                mobiles += $(this).parent().siblings('input[name="hidMobile"]').val();
                                if (i < lenNum - 1) {
                                    mobiles += ',';
                                }
                            }
                        });
                    }
                    if (mobiles == "") {
                        top.dialog({
                            title: '提示',
                            content: '对不起，手机号码不能为空！',
                            okValue: '确定',
                            ok: function () { }
                        }).showModal();
                        return false;
                    }
                    var smsdialog = parent.dialog({
                        title: '发送手机短信',
                        content: '<textarea id="txtSmsContent" name="txtSmsContent" rows="2" cols="20" class="input"></textarea>',
                        okValue: '确定',
                        ok: function () {
                            var remark = $("#txtSmsContent", parent.document).val();
                            if (remark == "") {
                                top.dialog({
                                    title: '提示',
                                    content: '对不起，请输入手机短信内容！',
                                    okValue: '确定',
                                    ok: function () { }
                                }).showModal(smsdialog);
                                return false;
                            }
                            var postData = { "mobiles": mobiles, "content": remark };
                            //发送AJAX请求
                            $.ajax({
                                type: "post",
                                url: "../../tools/admin_ajax.ashx?action=sms_message_post",
                                data: postData,
                                dataType: "json",
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    top.dialog({
                                        title: '提示',
                                        content: '尝试发送失败，错误信息：' + errorThrown,
                                        okValue: '确定',
                                        ok: function () { }
                                    }).showModal(smsdialog);
                                },
                                success: function (data, textStatus) {
                                    if (data.status == 1) {
                                        smsdialog.close().remove();
                                        var d = top.dialog({ content: data.msg }).show();
                                        setTimeout(function () {
                                            d.close().remove();
                                            location.reload();
                                        }, 2000);
                                    } else {
                                        top.dialog({
                                            title: '提示',
                                            content: '错误提示：' + data.msg,
                                            okValue: '确定',
                                            ok: function () { }
                                        }).showModal(smsdialog);
                                    }
                                }
                            });
                            return false;
                        },
                        cancelValue: '取消',
                        cancel: function () { }
                    }).showModal();
                }

                $(function () {
                    $("#userAdd").click(function () {
                        var objs = "id=<%=id%>&action=<%=DTEnums.ActionEnum.Add.ToString()%>";
                        showUserEditDialog(objs);
                    });


                });

                function showUserEditDialog(obj) {
                    var attachDialog = top.dialog({
                        id: 'attachDialogId',
                        title: "编辑账号",
                        url: 'dialog/dialog_user_edit.aspx?' + obj,
                        width: 600,
                        height: 700,
                        onclose: function () {
                            window.location = window.location.href.indexOf("pageindex") > 0 ? window.location.href : window.location.href + "&pageindex=2";
                        }
                    }).showModal();
                };

            </script>
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">
                            <ul class="icon-list">
                                <li><a style="cursor: pointer;" id="userAdd"><i class="iconfont icon-close"></i><span>新增</span></a></li>
                                <li><a href="javascript:;" onclick="PostSMS();"><i class="iconfont icon-mail"></i><span>短信</span></a></li>
                                <li><a href="javascript:;" onclick="checkAll(this);"><i class="iconfont icon-check"></i><span>全选</span></a></li>
                                <li>
                                    <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return ExePostBack('btnDelete');" OnClick="btnDelete_Click"><i class="iconfont icon-delete"></i><span>删除</span></asp:LinkButton></li>
                            </ul>
                            <div class="menu-list">
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">所有类型</asp:ListItem>
                                        <asp:ListItem Value="3">超级用户</asp:ListItem>
                                        <asp:ListItem Value="2">管理员</asp:ListItem>
                                        <asp:ListItem Value="1">普通</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">所有状态</asp:ListItem>
                                        <asp:ListItem Value="1">正常</asp:ListItem>
                                        <asp:ListItem Value="2">禁用</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtKeywords" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn-search" OnClick="btnSearch_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">
                <asp:Repeater ID="rptList" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th width="5%">选择</th>
                                <th align="left" colspan="2">用户名</th>
                                <th width="10%">账号类型</th>
                                <th width="10%">手机</th>
                                <th width="10%">邮箱</th>
                                <th width="10%">微信</th>
                                <th width="10%">状态</th>
                                <th width="10%">最后登录时间</th>
                                <th width="5%">操作</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" Style="vertical-align: middle;" />
                                <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                                <input name="hidMobile" type="hidden" value="<%#Eval("mobile")%>" />
                            </td>
                            <td width="64">
                                <a class="user-avatar" onclick="showUserEditDialog('action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("id")%>')" style="cursor: pointer">
                                    <%#Eval("avatar").ToString() != "" ? "<img width=\"64\" height=\"64\" src=\"" + Eval("avatar") + "\" />" : "<i class=\"iconfont icon-user-full\"></i>"%>
                                </a>
                            </td>
                            <td>
                                <div class="user-box">
                                    <h4><b><%#Eval("user_name")%></b>（姓名：<%#Eval("nick_name")%>）</h4>
                                    <i>公司：<%#Eval("companyName")%></i>
                                </div>
                            </td>
                            <td align="center"><%#Eval("group_id").ToString()=="1"?"管理员":Eval("group_id").ToString()=="2"?"超级用户":"普通"%></td>
                            <td align="center"><%#Eval("mobile")%></td>
                            <td align="center"><%#Eval("email")%></td>
                            <td align="center"><%#Eval("webchat")%></td>
                            <td align="center"><%#GetUserStatus(Convert.ToInt32(Eval("status")))%></td>
                            <td align="center"><%#new Donal.Xms.BLL.user_login_log().GetLastLoginTimeByUser(int.Parse(Eval("id").ToString()))%></td>
                            <td align="center"><a onclick="showUserEditDialog('action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("id")%>')" style="cursor: pointer">修改</a></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"9\">暂无记录</td></tr>" : ""%>
                </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <!--/列表-->

        </div>

        <div class="tab-content" <%=(pageindex!=1?"style=\"display: none;\"":"") %>>
            <script>
                $(function () {
                    $("#addressAdd").click(function () {
                        var objs = "id=<%=id%>&action=<%=DTEnums.ActionEnum.Add.ToString()%>";
                        showAddressEditDialog(objs);
                    });
                });

                function showAddressEditDialog(obj) {
                    var attachDialog = top.dialog({
                        id: 'addressDialogId',
                        title: "编辑地址",
                        url: 'dialog/dialog_address_edit.aspx?' + obj,
                        width: 600,
                        height: 450,
                        onclose: function () {

                        }
                    }).showModal();

                };

            </script>
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">
                            <ul class="icon-list">
                                <li><a style="cursor: pointer;" id="addressAdd"><i class="iconfont icon-close"></i><span>新增</span></a></li>
                                <li><a href="javascript:;" onclick="checkAll(this);"><i class="iconfont icon-check"></i><span>全选</span></a></li>
                                <li>
                                    <asp:LinkButton ID="btnDeleteAddress" runat="server" OnClientClick="return ExePostBack('btnDeleteAddress');" OnClick="btnDeleteAddress_Click">
                                        <i class="iconfont icon-delete"></i><span>删除</span></asp:LinkButton></li>
                            </ul>

                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtAddressKey" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnAddressFind" runat="server" CssClass="btn-search" OnClick="btnAddressFind_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">

                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                    <tr>
                        <th width="5%">选择</th>
                        <th width="5%">收件人</th>
                        <th width="10%">手机</th>
                        <th width="10%">电话</th>
                        <th width="10%">邮件</th>
                        <th width="15%">地区</th>
                        <th width="20%">地址</th>
                        <th width="10%">默认</th>
                        <th width="5%">操作</th>
                    </tr>
                    <asp:Repeater ID="rptAddress" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td align="center">
                                    <asp:CheckBox ID="chkAddressId" CssClass="checkall" runat="server" Style="vertical-align: middle;" />
                                    <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                                </td>
                                <td align="center"><%#Eval("accept_name")%></td>
                                <td align="center"><%#Eval("mobile")%></td>
                                <td align="center"><%#Eval("telphone")%></td>
                                <td align="center"><%#Eval("email")%></td>
                                <td align="center"><%#Eval("area")%></td>
                                <td align="center"><%#Eval("address")%></td>
                                <td align="center"><%#Eval("is_default").ToString()=="0"?"":Eval("is_default").ToString()=="1"?"默认为收货地址":Eval("is_default").ToString()=="2"?"默认为发票地址":Eval("is_default").ToString()=="3"?"收货与发票相同":""%></td>
                                <td align="center"><a onclick="showAddressEditDialog('action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("id")%>')" style="cursor: pointer">修改</a></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <%=rptAddress.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"9\">暂无记录</td></tr>" : ""%>
                </table>

            </div>
            <!--/列表-->

        </div>

        <div class="tab-content" <%=(pageindex!=5?"style=\"display: none;\"":"") %>>
            <script>
                $(function () {
                    $("#invoiceAdd").click(function () {
                        var objs = "id=<%=id%>&action=<%=DTEnums.ActionEnum.Add.ToString()%>";
                        showInvoiceEditDialog(objs);
                    });
                });

                function showInvoiceEditDialog(obj) {
                    var attachDialog = top.dialog({
                        id: 'addressDialogId',
                        title: "编辑发票信息",
                        url: 'dialog/dialog_user_invoice_edit.aspx?' + obj,
                        width: 600,
                        height: 450,
                        onclose: function () {

                        }
                    }).showModal();

                };

            </script>
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">
                            <ul class="icon-list">
                                <li><a style="cursor: pointer;" id="invoiceAdd"><i class="iconfont icon-close"></i><span>新增</span></a></li>
                                <li><a href="javascript:;" onclick="checkAll(this);"><i class="iconfont icon-check"></i><span>全选</span></a></li>
                                <li>
                                    <asp:LinkButton ID="btnDeleteInv" runat="server" OnClientClick="return ExePostBack('btnDeleteInv');" OnClick="btnDeleteInv_Click">
                                        <i class="iconfont icon-delete"></i><span>删除</span></asp:LinkButton></li>
                            </ul>

                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtInvKeywords" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnInvAdd" runat="server" CssClass="btn-search" OnClick="btnInvAdd_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">

                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                    <tr>
                        <th width="5%">选择</th>
                        <th width="5%">发票类型</th>
                        <th width="10%">单位名称</th>
                        <th width="5%">内容类</th>
                        <th width="10%">纳税人识别号</th>
                        <th width="10%">开户行</th>
                        <th width="10%">开户账号</th>
                        <th width="5%">是否默认</th>
                        <th width="5%">电话</th>
                        <th width="15%">注册地址</th>
                        <th width="5%">操作</th>
                    </tr>
                    <asp:Repeater ID="rptInv" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td align="center">
                                    <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" />
                                    <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                                </td>
                                <td align="center"><%#Eval("category").ToString()=="1"?"专用发票":"普通发票"%></td>
                                <td align="center"><%#Eval("company")%></td>
                                <td align="center"><%#Eval("content_type").ToString()=="1"?"穗":"花"%></td>
                                <td align="center"><%#Eval("registration")%></td>
                                <td align="center"><%#Eval("opening_bank")%></td>
                                <td align="center"><%#Eval("account_number")%></td>
                                <td align="center"><%#Eval("is_default").ToString()=="1"?"是":"否"%></td>
                                <td align="center"><%#Eval("telphone")%></td>
                                <td align="center"><%#Eval("registered_address")%></td>

                                <td align="center">
                                    <a onclick="showInvoiceEditDialog('action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("user_id")%>&invid=<%#Eval("id")%>')" style="cursor: pointer">修改</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <%=rptInv.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"11\">暂无记录</td></tr>" : ""%>
                </table>

            </div>
            <!--/列表-->

        </div>

        <div class="tab-content" <%=(pageindex!=3?"style=\"display: none;\"":"") %>>

            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>

                        <div class="r-list">
                            <asp:TextBox ID="txtInvoiceKey" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnInoviceFind" runat="server" CssClass="btn-search" OnClick="btnInvoiceFind_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">

                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                    <tr>
                        <th width="10%">发票号</th>
                        <th width="10%">发票抬头</th>
                        <th width="5%">发票类型</th>
                        <th width="5%">发票金额</th>
                        <th width="5%">会员编号</th>
                        <th width="10%">会员简称</th>
                        <th width="10%">会员级别</th>
                        <th width="5%">会员税点</th>
                        <th width="5%">物流方式</th>
                        <th width="8%">运单号</th>
                        <th width="8%">创建时间</th>
                        <th width="10%">备注</th>
                        <th width="5%">查看详情</th>
                    </tr>

                    <asp:Repeater ID="rptInvoice" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td align="center"><%#Eval("invoice_no")%></td>
                                <td align="center"><%#Eval("invoice_title")%></td>
                                <td align="center"><%#Eval("invoice_type")%></td>
                                <td align="center"><%#Eval("invoice_amount")%></td>
                                <td align="center"><%#Eval("erp_code")%></td>
                                <td align="center"><%#Eval("company")%></td>
                                <td align="center"><%#Eval("user_group")%></td>
                                <td align="center"><%#Eval("user_tax")%></td>
                                <td align="center"><%#Eval("express_title")%></td>
                                <td align="center"><%#Eval("express_no")%></td>
                                <td align="center"><%#Eval("add_time")%></td>
                                <td align="center"><%#Eval("remark")%></td>
                                <td align="center"><a href="invoice_edit.aspx?id=<%#Eval("id")%>">查看</a></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <%=rptInvoice.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"13\">暂无记录</td></tr>" : ""%>
                </table>

            </div>
            <!--/列表-->

            <!--内容底部-->
            <div class="line20"></div>
            <div class="pagelist">
                <div class="l-btns">
                    <span>显示</span><asp:TextBox ID="txtPageNumInvoice" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                        OnTextChanged="txtPageNumInvoice_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
                </div>
                <div id="PageContentInvoice" runat="server" class="default"></div>
            </div>
            <!--/内容底部-->

        </div>


        <%} %>

        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-wrap">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
        </div>
        <!--/工具栏-->

    </form>
</body>
</html>
